GdkRectangle area;
gint focus_line_width = 0;
gint focus_padding = 0;
+ gboolean touchscreen;
+
+ g_object_get (gtk_widget_get_settings (widget),
+ "gtk-touchscreen-mode", &touchscreen,
+ NULL);
range = GTK_RANGE (widget);
if (!sensitive)
state = GTK_STATE_INSENSITIVE;
- else if (range->layout->mouse_location == MOUSE_SLIDER)
+ else if (!touchscreen && range->layout->mouse_location == MOUSE_SLIDER)
state = GTK_STATE_PRELIGHT;
else
state = GTK_STATE_NORMAL;
draw_stepper (range, &range->layout->stepper_a,
range->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_UP : GTK_ARROW_LEFT,
range->layout->grab_location == MOUSE_STEPPER_A,
- range->layout->mouse_location == MOUSE_STEPPER_A,
+ !touchscreen && range->layout->mouse_location == MOUSE_STEPPER_A,
&expose_area);
if (range->has_stepper_b)
draw_stepper (range, &range->layout->stepper_b,
range->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
range->layout->grab_location == MOUSE_STEPPER_B,
- range->layout->mouse_location == MOUSE_STEPPER_B,
+ !touchscreen && range->layout->mouse_location == MOUSE_STEPPER_B,
&expose_area);
if (range->has_stepper_c)
draw_stepper (range, &range->layout->stepper_c,
range->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_UP : GTK_ARROW_LEFT,
range->layout->grab_location == MOUSE_STEPPER_C,
- range->layout->mouse_location == MOUSE_STEPPER_C,
+ !touchscreen && range->layout->mouse_location == MOUSE_STEPPER_C,
&expose_area);
if (range->has_stepper_d)
draw_stepper (range, &range->layout->stepper_d,
range->orientation == GTK_ORIENTATION_VERTICAL ? GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
range->layout->grab_location == MOUSE_STEPPER_D,
- range->layout->mouse_location == MOUSE_STEPPER_D,
+ !touchscreen && range->layout->mouse_location == MOUSE_STEPPER_D,
&expose_area);
return FALSE;
gtk_toggle_button_update_state (GtkButton *button)
{
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (button);
- gboolean depressed;
+ gboolean depressed, touchscreen;
GtkStateType new_state;
+ g_object_get (gtk_widget_get_settings (GTK_WIDGET (button)),
+ "gtk-touchscreen-mode", &touchscreen,
+ NULL);
+
if (toggle_button->inconsistent)
depressed = FALSE;
else if (button->in_button && button->button_down)
else
depressed = toggle_button->active;
- if (button->in_button && (!button->button_down || toggle_button->draw_indicator))
+ if (!touchscreen && button->in_button && (!button->button_down || toggle_button->draw_indicator))
new_state = GTK_STATE_PRELIGHT;
else
new_state = depressed ? GTK_STATE_ACTIVE : GTK_STATE_NORMAL;
gtk_widget_set_state (GtkWidget *widget,
GtkStateType state)
{
+ gboolean touchscreen;
+
g_return_if_fail (GTK_IS_WIDGET (widget));
if (state == GTK_WIDGET_STATE (widget))
return;
+ g_object_get (gtk_widget_get_settings (widget),
+ "gtk-touchscreen-mode", &touchscreen,
+ NULL);
+
+ if (touchscreen && state == GTK_STATE_PRELIGHT)
+ state = GTK_STATE_NORMAL;
+
if (state == GTK_STATE_INSENSITIVE)
gtk_widget_set_sensitive (widget, FALSE);
else